package com.shop.entity;

// Generated 2015-10-17 15:06:51 by Hibernate Tools 4.0.0

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * ProdCommt generated by hbm2java
 */
@Entity
@Table(name = "prod_commt", catalog = "shop")
public class ProdCommt implements java.io.Serializable {

	private Integer procId;
	private Customer customer;
	private Product product;
	private String procUuid;
	private String commtContent;
	private Integer commtScore;
	private Date commtDate;
	private boolean isCustomer;
	private String commtType;
	private String commtReply;
	private Set<PictureRelate> pictureRelates = new HashSet<PictureRelate>(0);

	public ProdCommt() {
	}

	public ProdCommt(Customer customer, Product product, String procUuid,
			Date commtDate, boolean isCustomer, String commtType) {
		this.customer = customer;
		this.product = product;
		this.procUuid = procUuid;
		this.commtDate = commtDate;
		this.isCustomer = isCustomer;
		this.commtType = commtType;
	}

	public ProdCommt(Customer customer, Product product, String procUuid,
			String commtContent, Integer commtScore, Date commtDate,
			boolean isCustomer, String commtType, String commtReply,
			Set<PictureRelate> pictureRelates) {
		this.customer = customer;
		this.product = product;
		this.procUuid = procUuid;
		this.commtContent = commtContent;
		this.commtScore = commtScore;
		this.commtDate = commtDate;
		this.isCustomer = isCustomer;
		this.commtType = commtType;
		this.commtReply = commtReply;
		this.pictureRelates = pictureRelates;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "proc_id", unique = true, nullable = false)
	public Integer getProcId() {
		return this.procId;
	}

	public void setProcId(Integer procId) {
		this.procId = procId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "cust_id", nullable = false)
	public Customer getCustomer() {
		return this.customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "prod_id", nullable = false)
	public Product getProduct() {
		return this.product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	@Column(name = "proc_uuid", nullable = false, length = 32)
	public String getProcUuid() {
		return this.procUuid;
	}

	public void setProcUuid(String procUuid) {
		this.procUuid = procUuid;
	}

	@Column(name = "commt_content", length = 100)
	public String getCommtContent() {
		return this.commtContent;
	}

	public void setCommtContent(String commtContent) {
		this.commtContent = commtContent;
	}

	@Column(name = "commt_score")
	public Integer getCommtScore() {
		return this.commtScore;
	}

	public void setCommtScore(Integer commtScore) {
		this.commtScore = commtScore;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "commt_date", nullable = false, length = 19)
	public Date getCommtDate() {
		return this.commtDate;
	}

	public void setCommtDate(Date commtDate) {
		this.commtDate = commtDate;
	}

	@Column(name = "is_customer", nullable = false)
	public boolean isIsCustomer() {
		return this.isCustomer;
	}

	public void setIsCustomer(boolean isCustomer) {
		this.isCustomer = isCustomer;
	}

	@Column(name = "commt_type", nullable = false, length = 10)
	public String getCommtType() {
		return this.commtType;
	}

	public void setCommtType(String commtType) {
		this.commtType = commtType;
	}

	@Column(name = "commt_reply", length = 100)
	public String getCommtReply() {
		return this.commtReply;
	}

	public void setCommtReply(String commtReply) {
		this.commtReply = commtReply;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "prodCommt")
	public Set<PictureRelate> getPictureRelates() {
		return this.pictureRelates;
	}

	public void setPictureRelates(Set<PictureRelate> pictureRelates) {
		this.pictureRelates = pictureRelates;
	}

}
